<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="../../include/easyui.jsp" %>
<script type="text/javascript" src="${path}/plug-in/echart/echarts.min.js"></script>
<html>
  <head>
	<title>回款统计报表</title>
  </head>
<body>
 <div id="main" style="width: 100%;height:500px;"></div>
</body>
<script type="text/javascript">
	// 指定图表的配置项和数据
	var myChart = echarts.init(document.getElementById('main'));
	// 指定图表的配置项和数据
	option = {
		 title : {
		        text: '工程回款统计报表（单位:万元）',
		        x:'center'
		    },
		    toolbox: {
		        show : true,
		        feature : {
		            dataView : {show: true, readOnly: false},
		            magicType : {show: true, type: ['line', 'bar']},
		            restore : {show: true},
		            saveAsImage : {show: true}
		        }
		    },
		    tooltip : {
		        trigger: 'item',
		        formatter: "{b} : {c}"
		    },
	    xAxis: {
	        type: 'category',
	        data: [],
	        axisLabel:{
	        	interval:3,//横轴信息全部显示
			    rotate:-40//-30度角倾斜显示
	        }
	    },
	    grid: {
	    	y2:100
	    },
	    yAxis: {
	        type: 'value'
	    },
	    series: []
	};

	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(option);
	
	$(function (){
		$.getJSON("/console/statistics/rewrite/echart", {type:'income'}, function(result){
			if(result.flag){
				myChart.setOption({
					xAxis:{
						data: result.data.legendData
					},
					series:[
						{
							name:'工程回款',
						    data: result.data.seriesData,
						    type: 'bar'
						}
					]
				});
			}
		});
	});
	
</script>
</html>